<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>MyHtml.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="./js/jquery.min-1.9.1.js"></script>
<script type="text/javascript">


var address = "127.0.0.1:7001";

var batchImages = [];
				
				
function init(){
	SunUpdatepatch = new ActiveXObject ("SunUpdatepatch.Updatepatch.1");

	var path="http://localhost:7001/TestService/updateOCX/";
	var nCount = SunUpdatepatch.UpdateInit(path,"Updatepatch.ini");
	

	if (nCount != -1) {
			for (var i = 0; i < nCount; i++) {
				var nRet = SunUpdatepatch.UpdateFile(i);
				alert("uuuu="+nRet);
			}
		} else {
			alert("无法连接上服务器，可能原因：\n1、网络不通\n2、服务器异常");
		}
	
	var nRet = SunUpdatepatch.UpdateComplete();
	alert("rrrrr="+nRet);
}

	function send() {
		var piccAux = new ActiveXObject("Picc.Aux");

		//alert("start");

		var appcode = "PNCALL";
		var busino = "test201706280911";
		var batchId = "0a89614173304b578fce7208ede94632";
		var interVer = "1";
		var xmlFileName = "0a89614173304b578fce7208ede94632_1.syd";
		var xmlStr = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+
"<doc><DocInfo><BATCH_ID>0a89614173304b578fce7208ede94632</BATCH_ID><BATCH_VER>1</BATCH_VER><INTER_VER>1</INTER_VER><BUSI_NO>test201706280911</BUSI_NO><BUSI_NAME>报案号</BUSI_NAME><APP_CODE>PNCALL</APP_CODE><STATUS>1</STATUS><CREATE_USER>admin</CREATE_USER><CREATE_DATE>2019-04-09 13:51:20</CREATE_DATE><MOD_USER>admin</MOD_USER><MOD_DATE>2019-04-09 13:51:20</MOD_DATE></DocInfo>"
+"<PageInfo><PAGE PAGEID=\"9e14201c-d014-42b2-83e9-f679eafb293e\"><CREATE_USER>admin</CREATE_USER><CREATE_TIME>2019-4-9 13:48:50</CREATE_TIME><MODIFY_USER>admin</MODIFY_USER><MODIFY_TIME>2019-04-09 13:51:20</MODIFY_TIME><PAGE_URL>v001_12.png</PAGE_URL><THUM_URL></THUM_URL><IS_LOCAL>1</IS_LOCAL><ORGINAL_NAME>11_8091_8094</ORGINAL_NAME><PAGE_VER>1</PAGE_VER><PAGE_DESC>11_8091_8094</PAGE_DESC><PAGE_CRC>BDFE8D4E10D9087B028A70E851398675</PAGE_CRC><PAGE_FORMAT>image/jpg</PAGE_FORMAT><PAGE_ENCRYPT>0</PAGE_ENCRYPT><EXT_INFO>"
			+"</EXT_INFO><ISPS>0</ISPS><ISMOD>0</ISMOD><ISPRI>0</ISPRI><FINAL_MD5>856B2D73E2F5BAE50A312A76218BDD6F</FINAL_MD5></PAGE></PageInfo>"
			+"<VTree><NODE ID=\"PNCALL_images\" NAME=\"损失照片\"><NODE ID=\"PNCALL_1_9500\" NAME=\"类别\"><NODE ID=\"PNCALL_2_9501\" NAME=\"损失照片\"><LEAF>9e14201c-d014-42b2-83e9-f679eafb293e</LEAF></NODE></NODE></NODE></VTree><Property>"
			+"</Property></doc>";
			//alert(xmlStr);
		alert(batchImages);
		result = piccAux.SubmitBatchHttp(appcode, busino, batchId, interVer,
				xmlFileName, xmlStr, batchImages, "http://" + address
						+ "/TestService/HttpsProcess");
		alert("result=" + result);

	}
	
	
		//回调函数
function OnPageEnd(filename, barcode, barcode2, orginalFileName) {
	
	
	
	
	batchImages.push(filename);
	
}


function OnBatchEnd(filename, barcode, barcode2, orginalFileName) {
	var $div = $("#imgDiv").empty();
	for(var i=0;i<batchImages.length;i++){
		var $img = $("<img />").css(
			"broder","1px solid red"
		)
		.prop({
			"src":batchImages[i],
			"width":"180",
			"heigth":"160"
		});
		$div.append($img);
	}
	

	
}



function daoru(){
//batchImages = [];
SunWebScan.ImportFiles(); //导入
}

</script>
  </head>
  
  <body>
  <div align="center">
  <div style="display: none">
  
   <OBJECT id=SunWebScan width="100%"
			classid=CLSID:D39FA4C3-2882-43BA-9889-EDE1227FF9A2>
			<param name="OnPageEndProc" value="OnPageEndProc" />
			<param name="OnBatchEndProc" value="OnPageBatchProc" />
		</OBJECT>
		<script type="text/javascript">
			SunWebScan.OnBatchEndProc = "OnBatchEnd";
			SunWebScan.OnPageEndProc = "OnPageEnd";
			SunWebScan.SaveFormat = "jpg";
			SunWebScan.FirstBarcodeLenth = "18";
			SunWebScan.SecendBarcodeLenth = "6";
			SunWebScan.BarcodeRecon = "T";
			SunWebScan.HalfTone = "T";
			SunWebScan.ClearCache = "false";
			SunWebScan.ThumbnailsWidth = "220";
			SunWebScan.ThumbnailsHeight = "150";
			SunWebScan.TIFSaveFormat = "tif";
			SunWebScan.JpgQuality = 50;
			SunWebScan.ThumbnailExt = ".jpg";
			SunWebScan.MultiPageDealState = 2;
		</script>
  </div>
    <div id="imgDiv" style="width: 800px;height: 400px">
    
    </div>
    <ul>
     <li><button onclick="init()">初始化</button></li>
    <li><button onclick="daoru()">导入</button></li>
      <li><button onclick="send()">提交</button></li>
    </ul>
    
    </div>
  </body>
</html>
